package com.experience.yledu.interview;


public class FiveQuest {
	
	
	/*public static void whileMethod(int[] array) {
	    if (array == null || array.length < 1) {
	        return;
	    }

	    int sum = 0;
	    int i = 0;

	    while ( i < array.length) {
	        sum += array[i];
	        i++;
	    }

	    System.out.println("while:"+sum);

	}

	public static void forMethod(int[] array) {
	    if (array == null || array.length < 1) {
	        return;
	    }

	    int sum = 0;
	    for (int num : array) {
	        sum += num;
	    }

	    System.out.println("for:"+sum);

	}

	public static int recursiveMethod(int[] array,int i) {
	    if (array == null || array.length < 1) {
	        return 0;
	    }

	    if (i < array.length ) {
	        return array[i] + recursiveMethod(array, i+1);
	    }

	    return 0;

	}

	public static void main(String[] args) {

	    int[] array = {1,3,4,5,7};

	    whileMethod(array);

	    forMethod(array);

	    System.out.println("recursive:"+recursiveMethod(array, 0));

	}*/
	
	/*private static String[] getStaggeredMergeArray(String[] arr1, String[] arr2) {
	    String[] arr = new String[arr1.length + arr2.length];
	    int i, j;
	    for (i = 0, j = 0; i < arr1.length; i++) {
	        j = 2 * i;
	        if (j > 2 * arr2.length)//若arr1数组长度长等于arr2
	            j = arr2.length + i;
	        arr[j] = arr1[i];//0 2 4 
	    }
	    for (i = 0, j = 0; i < arr2.length; i++) {
	        j = 2 * i + 1;
	        if (j > 2 * arr1.length)//若arr2数组长度长等于arr1
	            j = arr1.length + i;
	        arr[j] = arr2[i];//1 3 5 
	    }
	    return arr;
	}

	public static void main(String[] args) {

	    String[] arr1 = { "a", "B", "c" };
	    String[] arr2 = { "1", "2", "3" };       

	    String[] arr = getStaggeredMergeArray(arr1, arr2);

	    System.out.println(Arrays.toString(arr));
	}*/
	
	
	    public static void main(String[] args){  
	        double[] a=new double[100];  
	        a[0]=0;  
	        a[1]=1;  
	        System.out.print(a[0]+"\t"+a[1]+"\t");  
	        for(int i=2;i<100;i++){  
	            a[i]=a[i-1]+a[i-2];  
	            System.out.print(a[i]+"\t");  
	            if((i+1)%3==0)  
	                System.out.println();  
	        }  
	    }  
}
